import java.util.Arrays;
import java.util.Scanner;

public class Merge {
    public static void main(String args[]) {
        Scanner in=new Scanner(System.in);
        int len=in.nextInt();
        int[] arr=new int[len];
        for (int i=0; i<len; i++) {
            arr[i]=in.nextInt();
        }

        mergesort(arr,0,len-1);
        System.out.println(Arrays.toString(arr));
    }

    public static void mergesort(int[] arr,int low ,int high){
        
        if (low<high) {
            int mid=(high+low)/2;
            mergesort(arr,low,mid);
            mergesort(arr,mid+1,high);
            merge(arr,low,mid,high);
        }
    }

    public static void merge(int[] arr,int low,int mid, int high){

        int[] tmp=new int[high-low+1];
        int i=low;
        int j=mid+1;
        int index=0;
        while(i<=mid && j<=high){
            if (arr[i]<=arr[j]) {
                tmp[index]=arr[i];
                i++;
            }else{
                tmp[index]=arr[j];
                j++;
            }
            index++;
        }
    if (i<mid) {
        while(i<=mid){
            tmp[index]=arr[i];
            index++;
            i++;
        }
    }else{
        while(j<=high){
            tmp[index]=arr[j];
            index++;
            j++;
        }
    }
     System.arraycopy(tmp,0,arr,low,index);
    }
}
